home *** CD-ROM | disk | FTP | other *** search
/ CD School House 9 / CD School House 9.0 - Wayzata Technology (1994).iso / pc / dos / teachaid / babydos / chapt2 < prev    next >
Text File  |  1994-06-08  |  7KB  |  194 lines

  1.  
  2.                              CHAPTER 2
  3.  
  4.                    INTRODUCTION TO COLOR CODES
  5.                 Two Easy Steps To A World Of Color
  6.  
  7.         Having a color monitor takes advantage of the color codes
  8.         provided by the MS-DOS disk. These simple-to-learn codes
  9.         will spark life into programs that you write and provide as
  10.         many as 64 color combinations "free," just by typing a few short
  11.         color codes.
  12.         In the next sections, you will be creating color
  13.         combinations and Menus that will contain Speed Keys. When
  14.         creating these Menus you will also be adding a different color
  15.         combination to each one.
  16.       
  17.   └─   WHAT YOU WILL LEARN IN THIS CHAPTER
  18.         Ansi Escape Codes For Color
  19.         How To Use These Codes
  20.  
  21.   └─   HOW TO GET STARTED WITH COLOR
  22.         STEP 1.
  23.         You must copy from the MS-DOS disk a file called Ansi.Sys.
  24.         This file takes your color codes and adapts them so that your
  25.         color monitor can use them.
  26.         The next step is to store Ansi.Sys in a special file called
  27.         Config.Sys so that it will be available to DOS when the
  28.         computer is turned on.
  29.  
  30.         STEP 2.
  31.         The Ansi.Sys file must be stored in the Config.Sys file as
  32.         outlined on the next page. With this accomplished you will
  33.         have the necessary components to run the color codes and
  34.         have color appear on your color monitor.
  35.         You start by copying the Ansi.Sys file from the DOS disk
  36.         as follows:
  37.  
  38.         Insert the MS-DOS into the Computer.
  39.  
  40.         Next to the A> Prompt, type the following:
  41.  
  42.               Copy  Ansi.Sys  B:      <Press Enter key.>
  43.  
  44.         Follow the DOS prompts. Insert your disk when requested.
  45.         A copy of the Ansi.Sys file from MS-DOS disk will be transferred
  46.         to your disk.
  47.  
  48.    └─  ONE MORE STEP
  49.         Leave your disk in the computer.
  50.  
  51.         In this next step, you are going to create a Config.Sys file
  52.         in which you will put your Ansi.Sys command.
  53.         To do this: type the following next to the A> Prompt, like this:
  54.  
  55.                 Copy  Con  Config.Sys
  56.                 Device=Ansi.Sys
  57.                 F6        <Press Enter key to end the file.>
  58.           ------------
  59.         That's all there's to it!
  60.         You now have t e two files you need to get color.
  61.  
  62.  
  63.                              -6-
  64.  
  65.  
  66.  
  67.  
  68.    └─  The ANSI Color Escape Sequences
  69.         The word ANSI stands for the "American National
  70.         Standards Institute"  which developed these codes.
  71.         Below is a copy of the color Escape codes for setting
  72.         color to the background and letters.
  73.  
  74.         These codes are called the ANSI Escape Codes,
  75.         or Sequences for setting the foreground
  76.         (letters or text) and background colors. Type as indicated.
  77.         Don't use capital letters for the code.The Escape Code
  78.         always starts:
  79.         With a Dollar Sign ($)
  80.         A Small (e)
  81.         A Left Bracket ([ )
  82.         And ends with the small letter (m)
  83.    
  84.         All of the above parameters are used on the next page.
  85.  
  86.    └─  SPECIAL ATTRIBUTE COMMANDS
  87.         $e[0m  Normal, white on black
  88.         $e[1m  Bold, high intensity
  89.         $e[4m  Underline if available
  90.         $e[5m  Blink
  91.         $e[7m  Reverse video
  92.  
  93.         These five commands are called attribute commands.
  94.         They let you control the brightness, blinking and reverse video.
  95.  
  96.  
  97.    └─  THE COLOR CODES
  98.         $e[30m  black letters      $e[40m  black background
  99.         $e[31m  red letters        $e[41m  red background
  100.         $e[32m  green letters      $e[42m  green background
  101.         $e[33m  yellow letters     $e[43m yellow background
  102.         $e[34m  blue letters       $e[44m  blue background
  103.         $e[35m  magenta letters    $e[45m magenta background
  104.         $e[36m  cyan letters       $e[46m  cyan background
  105.         $e[37m  white letters      $e[47m  white background
  106.                   
  107.         The group of Ansi codes list 8 colors for the letters
  108.         and 8 colors for the background. Simple math shows
  109.         that 8 x 8 =64. Therefore, we have 64 possible
  110.         color combinations.
  111.                                                              
  112.    └─  HOW TO USE THESE COLOR CODES
  113.         There are a few simple rules you must follow if you want the
  114.         color codes to work:
  115.         ▀  You must always start with the word "Prompt".
  116.         ▀  Then the dollar sign, as the first entry after Prompt.
  117.         ▀  Then the small e  (Yes, you can use a capital E here.)
  118.         ▀  Then the left bracket.
  119.         ▀  End with a small m.  (small m, please)
  120.         ▀  Escape sequences may be combined by putting a
  121.            semicolon after each item.
  122.  
  123.    └─  YOUR FIRST ENTRY WILL BE TO CHANGE THE
  124.         Screen Color to Black and White.
  125.  
  126.  
  127.                                   -7-
  128.  
  129.  
  130.  
  131.  
  132.  
  133.         To do this, type the following next to the A> Prompt, like
  134.         this:
  135.   
  136.                 Prompt  $e[0m  $p$g
  137.                <Press Enter key.>
  138.  
  139.         The $e[0m is the code to reverse all colors to black and
  140.         white. This is known as reverse video. Your screen will
  141.         remain black and white until you add some of your own
  142.         color or use a commercial program that has its own color
  143.         program, or restart your computer.
  144.  
  145.         You should now have your original black and white
  146.         colors on your screen. If you still have color on your screen,
  147.         recheck the way you entered the Ansi Escape codes.
  148.    
  149.    └─  It is important that you type the codes exactly as shown.
  150.         Make certain that:
  151.  
  152.         ▀  The first word is "Prompt.                    Prompt
  153.         ▀  The second word is the dollar sign ($).       Prompt $
  154.         ▀  The third word  is the small (e).             Prompt $e
  155.         ▀  The next, the left bracket  ( [ )             Prompt $e[
  156.         ▀  Then the code number                          Prompt $e[7m
  157.         ▀  Finally,next to the code type $p$g            Prompt $e[7m $p$g
  158.                   
  159.         The $p$g gives you this subdirectory prompt A:\>.
  160.  
  161.         When you type Escape codes and can't get any color change
  162.         on the screen, you must restart (boot) your computer to
  163.         enter these new escape commands into the computer's
  164.         "memory."
  165.  
  166.                        *** END OF CHAPTER
  167.  
  168.                  Press <ESC> key to return to Menu.
  169.  
  170.               Select "CHAPTER 3"  "Color Combinations"
  171.                       <Press Enter key>
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                 -8-
  194.